<template>
	<el-dialog width="1400px" title="查看审批资料" :visible.sync="dialogVisible" :close-on-click-modal="false">
		<a-form class="form" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
			<a-card class="card" title="基本信息" :bordered="false">
				<a-row class="form-row">
					<a-col :xl="{span: 6}">
						<a-form-item label="入驻时间" prop="create_time">
							<p >{{form.create_time}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="失效日期" prop="end_time">
							<p >{{form.end_time}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="姓名" prop="faname">
							<p >{{form.faname}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="身份证号" prop="idcard">
							<p >{{form.idcard}}</p>
						</a-form-item>
					</a-col>
			
				</a-row>
				<a-row>
					<a-col :xl="{span: 6}">
						<a-form-item label="联系人" prop="people">
							<p >{{form.people}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="联系电话" prop="contact_tel">
							<p >{{form.contact_tel}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="推广模式" prop="type">
							<p >{{form.type==1?"线上":"线下"}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="推广类型" prop="user_type">
							<p >{{form.user_type==1?"企业":"个人"}}</p>
						</a-form-item>
					</a-col>
				</a-row>
				<a-row class="form-row">
					<a-col :xl="{span: 6}">
						<a-form-item label="支付宝账号" prop="alipayaccount">
							<p >{{form.alipayaccount==null?"无":form.alipayaccount}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="邮箱地址" prop="email">
							<p >{{form.email==null?"无":form.email}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="账户余额" prop="balance">
							<p >{{form.balance==null?"0.00":form.balance}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="账户冻结金额" prop="balance_end">
							<p >{{form.balance_end==null?"0.00":form.balance_end}}</p>
						</a-form-item>
					</a-col>
					<a-col :lg="6" :md="12" :sm="24">
						<a-form-item label="邀请码" prop="code">
							<p >{{form.code}}</p>
						</a-form-item>
					</a-col>
					<a-col :lg="6" :md="12" :sm="24">
						<a-form-item label="分成率" prop="rate">
							<p >{{form.rate}}%</p>
						</a-form-item>
					</a-col>
					<a-col :lg="6" :md="12" :sm="24">
						<a-form-item label="推广级别" prop="level">
							<p >{{form.level==1?"一级推广员":"二级推广员"}}</p>
						</a-form-item>
					</a-col>
					<a-col :lg="6" :md="12" :sm="24">
						<a-form-item label="推广区域" prop="area_id">
							<p >{{ form.area_id }}</p>
						</a-form-item>
					</a-col>
				</a-row>
				<a-row class="form-row">
					<a-col :xl="{span: 6}">
						<a-form-item label="备注" prop="remark">
							<p >{{form.remark==null?"无":form.remark}}</p>
						</a-form-item>
					</a-col>
				</a-row>
			</a-card>
			<a-card v-if="form.user_type==1?true:false" class="card" title="公司信息" :bordered="false">
				<a-row class="form-row">
					<a-col :xl="{span: 6}">
						<a-form-item label="公司/机构名称" prop="mechanism">
							<p >{{form.mechanism}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="公司/机构地址" prop="address">
							<p >{{form.address}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="法人姓名" prop="faname">
							<p >{{form.faname}}</p>
						</a-form-item>
					</a-col>
					<a-col :xl="{span: 6}">
						<a-form-item label="法人身份证号" prop="idcard">
							<p >{{form.idcard}}</p>
						</a-form-item>
					</a-col>
				</a-row>
			
				<a-row class="form-row">
					<!-- <a-col :xl="{span: 6}">
						<a-form-item label="营业执照照片">
							<preview-img  :img-url="form.shopcard"></preview-img>
							<crop-upload v-show="isEdit" show-type="photo" :init-val="form.shopcard"
								wrapper-width="95px" wrapper-height="95px" @setVal="(val) => setUrl('shopcard', val)" />
						</a-form-item>
					</a-col> -->
					<!-- <a-col :xl="{span: 6}">
						<a-form-item label="法人身份证正面照">
							<preview-img  :img-url="form.faidcard"></preview-img>
							<crop-upload v-show="isEdit" show-type="photo" :init-val="form.faidcard"
								wrapper-width="95px" wrapper-height="95px" @setVal="(val) => setUrl('faidcard', val)" />
						</a-form-item>
					</a-col> -->
					<!-- <a-col :xl="{span: 6}">
						<a-form-item label="法人身份证背面照">
							<preview-img  :img-url="form.faidcard_back"></preview-img>
							<crop-upload v-show="isEdit" show-type="photo" :init-val="form.faidcard_back"
								wrapper-width="95px" wrapper-height="95px"
								@setVal="(val) => setUrl('faidcard_back', val)" />
						</a-form-item>
					</a-col> -->
					<a-col :xl="{span: 6}">
						<a-form-item label="统一社会信用代码" prop="companyid">
							<p >{{form.companyid}}</p>
						</a-form-item>
					</a-col>
			
				</a-row>
			
			</a-card>
		</a-form>
	</el-dialog>
</template>

<script>
	// import {
	// 	saleApplyDetail
	// } from '@/api/extension'
	// import previewImg from '@/components/common/previewImg'
	export default {
		name: 'centerDialog',
		components:{
			// previewImg
		},
		props: {
			saleUserId: {
				type: Number,
				default: 0
			},
			editList:{
				type:Object,
				default:()=>({})
			}
		},
		data() {
			return {
				form: {
					people: '',
					contact_tel: '',
					type: '',
					user_type: '',
					level: '',
					shopcity: '',
					code: '',
					rate: '',
					mechanism: '',
					address: '',
					faname: '',
					idcard: '',
					faidcard: '',
					faidcard_back: '',
					companyid: '',
					create_time: '',
					alipayaccount: '',
					email: '',
					end_time: '',
					balance: '',
					balance_end: '',
					remark: '',
					shopcard: '',
					company_area: ''
				},
				tableData: {},
				dialogVisible: false
			}
		},
		watch: {
			dialogVisible(val) {
				console.log(this.editList);
				if (val) {
					this.getData()
				}
			}
		},
		methods: {
			getData() {
				console.log(this.saleUserId);
				// saleApplyDetail(this.saleUserId).then(res => {
				// 	this.tableData = res
				// 	console.log(res);
				// })
				for (let key in this.form) {
					this.form[key] = this.editList[key]
				}
			}
		}
	}
</script>

<style lang="less" scoped>

</style>
